#pragma once

#include "Event.h"

namespace Orange
{

    class WindowResizeEvent : public Event
    {
    public:
        WindowResizeEvent(unsigned int width, unsigned int height) : m_width(width), m_height(height)
        {
        }

        inline unsigned int GetWidth() { return m_width; };
        inline unsigned int GetHeight() { return m_height; };

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "WindowResizeEvent:" << m_width << "," << m_height;
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryApplication);
        EVENT_CLASS_TYPE(WindowResize);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryApplication;
        };
        static EventType GetStaticEventType()
        {
            return EventType::WindowResize;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "WindowResize"; };
#endif

    protected:
        unsigned int m_width;
        unsigned int m_height;
    };

    class WindowCloseEvent : public Event
    {
    public:
        WindowCloseEvent() {}
        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "WindowCloseEvent:";
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryApplication);
        EVENT_CLASS_TYPE(WindowClose);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryApplication;
        };
        static EventType GetStaticEventType()
        {
            return EventType::WindowClose;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "WindowClose"; };
#endif
    };

    class AppUpdateEvent : public Event
    {
    public:
        AppUpdateEvent() {}

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryApplication);
        EVENT_CLASS_TYPE(AppUpdate);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryApplication;
        };
        static EventType GetStaticEventType()
        {
            return EventType::AppUpdate;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "AppUpdate"; };
#endif
    };

    class AppTickEvent : public Event
    {
    public:
        AppTickEvent() {}

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryApplication);
        EVENT_CLASS_TYPE(AppTick);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryApplication;
        };
        static EventType GetStaticEventType()
        {
            return EventType::AppTick;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "AppTick"; };
#endif
    };

    class AppRenderEvent : public Event
    {
    public:
        AppRenderEvent() {}

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryApplication);
        EVENT_CLASS_TYPE(AppRender);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryApplication;
        };
        static EventType GetStaticEventType()
        {
            return EventType::AppRender;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "AppRender"; };
#endif
    };
}